import Vue from 'vue'
import Router from 'vue-router'

//首页（商品列表页）
import GoodsList from '@/pages/goodsList/GoodsList.vue'
import GoodsDetail from '@/pages/goodsDetail/GoodsDetail.vue'
//全部分类
import GoodsTypeList from '@/pages/goodsTypeList/GoodsTypeList.vue'
//购物车
import ShopCart from '@/pages/shopCart/ShopCart.vue'
//确认订单页面
import OrderConfirm from '@/pages/orderConfirm/OrderConfirm.vue'
//立即购买确认订单页面
import OrderConfirmNow from '@/pages/orderConfirmNow/OrderConfirmNow.vue'
//收银台页面
import Payment from '@/pages/payment/Payment.vue'
//支付成功或失败页面
import PayComplete from '@/pages/payComplete/PayComplete.vue'
//订单列表
import OrderList from '@/pages/orderList/OrderList.vue'
//订单详情
import OrderDetail from '@/pages/orderDetail/OrderDetail.vue'
//地址列表
import AddressList from '@/pages/addressList/AddressList.vue'
//添加、修改地址 
import AddressDetail from '@/pages/addressDetail/AddressDetail.vue'
//个人中心
import Center from '@/pages/center/Center.vue'
//成为加盟商
import MerchantAdd from '@/pages/merchantAdd/MerchantAdd.vue'
//退款
import Refund from '@/pages/refund/Refund.vue'
//生成退货申请
import OrderDetailReturn from '@/pages/orderDetailReturn/OrderDetailReturn.vue'
//退货列表
import ReturnGoodsList from '@/pages/returnGoodsList/ReturnGoodsList.vue'
//退货详情
import ReturnGoodsDetail from '@/pages/returnGoodsDetail/ReturnGoodsDetail.vue'
//加盟商中心
import MerchantCenter from '@/pages/merchantCenter/MerchantCenter.vue'
//加盟商订单状态选择
import MerchantOrderState from '@/pages/merchantOrderState/MerchantOrderState.vue'
//加盟商订单
import MerchantOrderList from '@/pages/merchantOrderList/MerchantOrderList.vue'
//加盟商订单详情
import MerchantOrderDetail from '@/pages/merchantOrderDetail/MerchantOrderDetail.vue'
//加盟商退单列表
import MerchantReturnList from '@/pages/merchantReturnList/MerchantReturnList.vue'
//加盟商退单详情
import MerchantReturnDetail from '@/pages/merchantReturnDetail/MerchantReturnDetail.vue'
//加盟商添加银行卡
import BankAdd from '@/pages/bankAdd/BankAdd.vue'
//加盟商银行卡列表
import BankList from '@/pages/bankList/BankList.vue'
//加盟商提现
import Drawcash from '@/pages/drawcash/Drawcash.vue'
//设置
import Setting from '@/pages/setting/index.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/goodsList'
    },
    {
      path: '/goodsList',
      name: 'GoodsList',
      component: GoodsList
    },
    {
      path: '/goodsTypeList',
      name: 'GoodsTypeList',
      component: GoodsTypeList
    },
    {
      path: '/shopCart',
      name: 'ShopCart',
      component: ShopCart
    },
    {
      path: '/goodsTypeList/goodsDetail/:id',
      name: 'GoodsDetail',
      component: GoodsDetail
    },
    {
      path: '/orderConfirm',
      name: 'OrderConfirm',
      component: OrderConfirm
    },
    {
      path: '/orderConfirmNow',
      name: 'OrderConfirmNow',
      component: OrderConfirmNow
    },
    {
      path: '/payment',
      name: 'Payment',
      component: Payment
    },
    {
      path: '/payComplete',
      name: 'PayComplete',
      component: PayComplete
    },
    {
      path: '/center/orderList/:state',
      name: 'OrderList',
      component: OrderList
    },
    {
      path: '/center/orderList/orderDetail/:id',
      name: 'OrderDetail',
      component: OrderDetail
    },
    {
      path: '/addressList',
      name: 'AddressList',
      component: AddressList
    },
    {
      path: '/addressDetail/:id',
      name: 'AddressDetail',
      component: AddressDetail
    },
    {
      path: '/center',
      name: 'Center',
      component: Center
    },
    {
      path: '/center/merchantAdd',
      name: 'MerchantAdd',
      component: MerchantAdd
    },
    {
      path: '/center/orderList/orderDetail/refund/:id',
      name: 'Refund',
      component: Refund
    },
    {
      path: '/center/orderDetailReturn/:order_code/:index',
      name: 'OrderDetailReturn',
      component: OrderDetailReturn
    },
    {
      path: '/center/returnGoodsList',
      name: 'ReturnGoodsList',
      component: ReturnGoodsList
    },
    {
      path: '/center/returnGoodsList/returnGoodsDetail/:id/:mid/:goodid',
      name: 'ReturnGoodsDetail',
      component: ReturnGoodsDetail
    },
    {
      path: '/center/merchantCenter',
      name: 'MerchantCenter',
      component: MerchantCenter
    },
    {
      path: '/center/merchantCenter/merchantOrderState',
      name: 'MerchantOrderState',
      component: MerchantOrderState
    },
    {
      path: '/center/merchantCenter/merchantOrderList',
      name: 'MerchantOrderList',
      component: MerchantOrderList
    },
    {
      path: '/center/merchantCenter/merchantOrderDetail/:id',
      name: 'MerchantOrderDetail',
      component: MerchantOrderDetail
    },
    {
      path: '/center/merchantCenter/merchantReturnList',
      name: 'MerchantReturnList',
      component: MerchantReturnList
    },
    {
      path: '/center/merchantCenter/merchantReturnDetail/:id/:mid',
      name: 'MerchantReturnDetail',
      component: MerchantReturnDetail
    },
    {
      path: '/center/bankList',
      name: 'BankList',
      component: BankList
    },
    {
      path: '/center/bankAdd/:id',
      name: 'BankAdd',
      component: BankAdd
    },
    {
      path: '/center/drawcash/:balance',
      name: 'Drawcash',
      component: Drawcash
    },
    {
      path:'/setting',
      name:'Setting',
      component:Setting
    }
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (about.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
    // }
  ]
})
